package es.cazadoresmadridejos.model;

import java.math.BigDecimal;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity(name="BudgetLine")
@Table(name="linea_presupuesto")
public class BudgetLine extends BaseEntity {

	public enum LineType {
		INCOMING,PAYMENT
	}
	
	private Budget budget;
	private String description;
	private BigDecimal amount;
	private LineType type;

	@Enumerated(EnumType.STRING)
	@Column(name="tipo")
	public LineType getType() {
		return type;
	}
	public void setType(LineType type) {
		this.type = type;
	}
	@ManyToOne(optional=false)
	@JoinColumn(name="presupuesto")	
	public Budget getBudget() {
		return budget;
	}
	public void setBudget(Budget budget) {
		this.budget = budget;
	}
	@Column(name="descripcion")
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	@Column(name="coste")
	public BigDecimal getAmount() {
		return amount;
	}
	public void setAmount(BigDecimal amount) {
		this.amount = amount;
	}
	
	
}
